import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi";

// 查询设备信息列表
export function listEquipment(query) {
  return request({
    url: '/equipment/equipment/list',
    method: 'get',
    params: query
  })
}

// 查询设备信息详细
export function getEquipment(id) {
  return request({
    url: '/equipment/equipment/' + praseStrEmpty(id),
    method: 'get'
  })
}

// 新增设备信息
export function addEquipment(data) {
  return request({
    url: '/equipment/equipment',
    method: 'post',
    data: data
  })
}

// 修改设备信息
export function updateEquipment(data) {
  return request({
    url: '/equipment/equipment',
    method: 'put',
    data: data
  })
}

// 删除设备信息
export function delEquipment(id) {
  return request({
    url: '/equipment/equipment/' + id,
    method: 'delete'
  })
}

// 设备状态修改
export function changeEquipmentStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/equipment/equipment/changeStatus',
    method: 'put',
    data: data
  })
}

// 导出设备信息
export function exportEquipment(query) {
  return request({
    url: '/equipment/equipment/export',
    method: 'get',
    params: query
  })
}
